﻿#ifndef CHANGEUSERPWD_H
#define CHANGEUSERPWD_H

#include "SheetGlobal.h"

#include <QDialog>

namespace Ui{ class ChangeUserPwd; }

class SHEET_EXPORT ChangeUserPwd : public QDialog
{
	Q_OBJECT

public:
	ChangeUserPwd(QString username, QString userid, QString passwd, QWidget *parent = 0);
	~ChangeUserPwd();

public:
	void initUI();

protected slots:
	void on_btnChangePwd_clicked();

private:
	bool changePwd(QString userid, QString newpwd, QString confirmpwd);
	bool check(QString oldpwd);
	QString getPasswdEncryptByMd5(const QString strOriginal);

signals:
	void changePasswd(bool bSuccess);
	void closeWidget();

private:
	Ui::ChangeUserPwd * ui;
	QString strUserName;
	QString strUserId;
	QString strUserPwd;
};

#endif // CHANGEUSERPWD_H
